From: Florian Müllner Date: Thu, 18 Sep 2014 12:29:35 +0000 (+0100) Subject: iconGrid: Don't use clones for pulse animation X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2083 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=63efe1db11ce6ef8824ed8e8fd2125aa59424f65;p=gnome-shell.git iconGrid: Don't use clones for pulse animation The spring animation has to use clones to escape any clip set on the parent, as it mainly occurs outside the parent. The same does not apply to the pulse animation, which is very much in place - in fact, if the parent is clipped (for instance a scrolled app folder), not having the clip applied to the animated icons is indeed wrong. Just animate the original grid actors instead, which gives the expected result. https://bugzilla.gnome.org/show_bug.cgi?id=736885 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 9432bdf0d..a35489b61 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -431,31 +431,21 @@ const IconGrid = new Lang.Class({ for (let index = 0; index < actors.length; index++) { let actor = actors[index]; - actor.opacity = 0; actor.reactive = false; + actor.set_scale(0, 0); + actor.set_pivot_point(0.5, 0.5); let delay = index / actors.length * ANIMATION_MAX_DELAY_FOR_ITEM; - let [originalX, originalY] = actor.get_transformed_position(); - let [originalWidth, originalHeight,,] = this._getAllocatedChildSizeAndSpacing(actor); - - let actorClone = new Clutter.Clone({ source: actor }); - Main.uiGroup.add_actor(actorClone); - - actorClone.set_position(originalX, originalY); - actorClone.set_scale(0, 0); - actorClone.set_pivot_point(0.5, 0.5); - actorClone.set_size(originalWidth, originalHeight); - let bounceUpTime = ANIMATION_TIME_IN / 4; let isLastItem = index == actors.length - 1; - Tweener.addTween(actorClone, + Tweener.addTween(actor, { time: bounceUpTime, transition: 'easeInOutQuad', delay: delay, scale_x: ANIMATION_BOUNCE_ICON_SCALE, scale_y: ANIMATION_BOUNCE_ICON_SCALE, onComplete: Lang.bind(this, function() { - Tweener.addTween(actorClone, + Tweener.addTween(actor, { time: ANIMATION_TIME_IN - bounceUpTime, transition: 'easeInOutQuad', scale_x: 1, @@ -463,10 +453,7 @@ const IconGrid = new Lang.Class({ onComplete: Lang.bind(this, function() { if (isLastItem) this._animationDone(); - - actor.opacity = 255; actor.reactive = true; - actorClone.destroy(); }) }); })